//
//  SEDoctorInfoCenterView.m
//  kuaiyi
//
//  Created by vn on 16/7/8.
//  Copyright © 2016年 Alphts. All rights reserved.
//

#import "SEDoctorInfoCenterView.h"

@interface SEDoctorInfoCenterView ()

@end


@implementation SEDoctorInfoCenterView


- (instancetype)init{
    
    if (self = [super init]) {
        
        [self setUpUI];
        
    }
    
    return self;
    
}


//布局子空间
- (void)setUpUI{
    
    [self addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        
        make.centerX.mas_equalTo(self.mas_centerX);
        make.top.offset(10);
        make.width.offset(2);
        make.height.offset(30);
        
        
    }];

    [self addSubview:self.condition_btn];
    [self.condition_btn addTarget:self action:@selector(didClickButton:) forControlEvents:UIControlEventTouchUpInside];

    [self.condition_btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        
        make.top.mas_equalTo(self.mas_top).offset(10);
        make.centerX.equalTo(self.centerX).multipliedBy(0.5);
        
        
    }];

    
    [self addSubview:self.doctorInfo_btn];
    [self.doctorInfo_btn addTarget:self action:@selector(didClickButton:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.doctorInfo_btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        
        make.top.mas_equalTo(self.condition_btn.mas_top);
        
        
        
        make.centerX.equalTo(self.centerX).multipliedBy(1.5);
        
        
    }];

    
    
    [self addSubview:self.moveView];
    [self.moveView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.mas_equalTo(self.condition_btn.mas_bottom).offset(3);
        make.width.mas_offset(80);
        make.height.mas_offset(2);
        make.centerX.mas_equalTo(self).multipliedBy(0.5);
        
        
    }];

    
}

#pragma mark -- 监听方法
- (void)didClickButton:(UIButton *)sender{
    
    if ([self.delegate respondsToSelector:@selector(centerView:withButton:)]) {
        
        [self.delegate centerView:self withButton:sender];
        
    }
    
}

#pragma mark -- lazy控件
- (UIView *)moveView{
    
    if (_moveView == nil) {
       
        
        _moveView = [[UIView alloc]init];
        
        _moveView.backgroundColor = kThemeColor;
        
     }
    
    return _moveView;
}




 - (UIView *)lineView{
    
    if (_lineView == nil) {
        
        
        _lineView = [[UIView alloc]init];
        _lineView.backgroundColor = [UIColor grayColor];
 
        
    }
    
    return _lineView;
    
}

 - (UIButton *)doctorInfo_btn{
    
    if (_doctorInfo_btn == nil) {
        
       
         _doctorInfo_btn = [[UIButton alloc]init];
        [_doctorInfo_btn setTitle:@"医生简介" forState:UIControlStateNormal];
        
        _doctorInfo_btn.tag = 2;
        [_doctorInfo_btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];

        
    }
    
    
    return _doctorInfo_btn;
    
}

- (UIButton *)condition_btn{
    
    if (_condition_btn == nil) {
        
        _condition_btn = [[UIButton alloc]init];
        _condition_btn.tag = 1;
        [_condition_btn setTitle:@"就诊条件" forState:UIControlStateNormal];
        [_condition_btn setTitleColor:kThemeColor forState:UIControlStateNormal];
        
    }
    
    
    return _condition_btn;
}



@end
